package com.auxgroup.hr.front.site.co.process;

import java.util.List;
import java.util.Set;

import javax.annotation.Resource;

import com.auxgroup.hr.front.site.co.BaseWfCO;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.auxgroup.hr.front.commons.BaseRetCode;
import com.auxgroup.hr.front.commons.vo.BaseResponseVO;
import com.auxgroup.hr.front.dao.domain.PsCWfPersonVw;
import com.auxgroup.hr.front.dozer.IObjectMapper;
import com.auxgroup.hr.front.service.process.WfPersonVwService;
import com.auxgroup.hr.front.site.co.BaseCO;

/**
 * 加签人员列表CO
 * @author wangchangyun
 * @version 创建时间：180601 
 */
@RestController
@RequestMapping("${auxgroup.hr.contextPath}/wfPersonVw")
public class WfPersonVwCO extends BaseCO {

	private static final Logger logger = LoggerFactory.getLogger(WfPersonVwCO.class);

	@Autowired
	public WfPersonVwService wfPersonVwService;

	@Resource(name = "dozerMapper")
	protected IObjectMapper objectMapper;

	/**
	 * 根据条件查询
	 * @param emplid 员工id
	 * @param name 姓名
	 * @param dept 部门
	 * @param job 岗位
	 * @return
	 */
	@GetMapping(value = "/getAll")
	public BaseResponseVO getAll(String queryValue){
		logger.info("getWfPersonVw param= {}", queryValue);
		if(StringUtils.isBlank(queryValue)){
			return buildRespone(BaseRetCode.CODE_ERROR_REQUEST_PARAM_NULL);
		}
		List<PsCWfPersonVw> list = wfPersonVwService.getAll(queryValue);
		return buildRespone(list,false);
	}
	
	/**
	 * 获取加签人员
	 * @param hireId
	 * @return
	 */
	@GetMapping(value = "/getOne")
	public BaseResponseVO getOne(String emplId) {
		logger.info("getWfPersonVw param= {}", emplId);
		PsCWfPersonVw wfPersonVw = wfPersonVwService.getWfPersonVw(emplId);
		return buildRespone(wfPersonVw);
	}

}
